package com.example.CollaborativeDiscussionLearning.utils;

import cn.hutool.core.codec.Base64Encoder;
import cn.hutool.core.io.FileUtil;
import java.io.File;

public class HutoolUtil {

    /*将本地图片转换成base64字符串*/
    public static String imageToBase64String(String imgPath){
        File file=new File(imgPath);
        String encodeA= Base64Encoder.encode(FileUtil.readBytes(file));
        return encodeA;
    }
}
